from db.db_base import BaseModel
from sqlalchemy import Column, String, Integer, DateTime, Enum, ForeignKey
from sqlalchemy.orm import relationship
# from apps.device.camera.models.camera import Camera


class Room(BaseModel):
    __tablename__ = 'room'
    __table_args__ = {'comment': '房间表'}

    name = Column(String(100),
                  nullable=False,
                  comment="房间名称，唯一标识",
                  unique=True,
                  )
    type = Column(Enum('hospital', 'residential'),
                  nullable=False,
                  comment="房间类型，医院或住宅",
                  default='residential',
                  )
    location = Column(String(255),
                      nullable=False,
                      comment="房间位置，详细地址",
                      )
    cameras = relationship("Camera", back_populates="room")
